<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>第 11 题</title>
    <script type="text/javascript">
        /*
            11、数组去重；
                [1,1,1,2,2,3,4,5,6,3,4,2,4,1] => [1,2,3,4,5,6]
        */

        // 创建数组
        var oArr = [1, 1, 1, 2, 2, 3, 4, 5, 6, 3, 4, 2, 4, 1,];

        // 循环
        for (a = 0; a <= oArr.length - 1; a++) {
            for (var b = a + 1; b <= oArr.length - 1; b++) {
                // 判断是否重复
                if (oArr[a] === oArr[b]) {
                    // 删除当前的值
                    oArr.splice(b, 1);
                    // 删除后原数组下标前移
                    b--;
                }
            }
        }

        // 后台输出
        console.log(oArr);

    </script>
</head>

<body>

</body>

</html>